home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / dirbar11.lha / paz / dirbar11.asm
Encoding:
Assembly Source File  |  1993-04-18  |  15.6 KB  |  759 lines

  1.  
  2. *******************************************************************
  3. * *                                                             * *
  4. * * DirBar by David Jenkins.                     * *                                                             * *
  5. * *                                 * *
  6. * *                                                             * *
  7. *******************************************************************
  8.  
  9. mvc    macro
  10.     lea    \1,a0    source
  11.     lea    \2,a1    destination
  12.     moveq    #\3-1,d0    count
  13. move\@    move.b    (a0)+,(a1)+    move byte
  14.     dbra    d0,move\@
  15.      endm
  16.  
  17.      nolist
  18.           include  "exec/types.i"
  19.           include  "exec/memory.i"
  20.           include  "offsets/exec.ofs"
  21.           include  "offsets/dos.ofs"
  22.           include  "offsets/intuit.ofs"
  23.           include  "offsets/translat.ofs"
  24.           include  "offsets/layers.ofs"
  25.  
  26.           include  "libraries/dos.i"
  27.  
  28.           include  "devices/serial.i"
  29.           include  "devices/console.i"
  30.       include  "intuition/intuition.i"
  31.     
  32.     list
  33.  
  34.  
  35. * -------------------------------------------------------------- *
  36.  
  37. sysbase    equ    4
  38.  
  39.  
  40.  
  41. startup  move.l   sp,saveSP        Save the stack pointer, just in case
  42.  
  43. * Open Layers library
  44.  
  45.     lea     layersname,a1
  46.     moveq   #0,d0        ; load version number
  47.     movea.l 4,a6        ; load exec library address
  48.     jsr     OpenLibrary(A6)    ; call OpenLibrary
  49.     tst.l   d0        ok?
  50.     bne    layok        yes
  51.     rts
  52. layok    move.l    d0,layers    save
  53.  
  54.  
  55.  
  56. * Open intuition library
  57.  
  58.     lea     IntuitionName(PC),A1
  59.     moveq   #0,d0        ; load version number
  60.     movea.l    4,a6        ; load exec library address
  61.     jsr     OpenLibrary(A6)    ; call OpenLibrary
  62.     tst.l   d0
  63.     bne.s    1$
  64.     move.l    #24,ret        return code
  65.     bra    layerbye
  66. 1$    move.l    d0,intuit    ; store intuition library pointer
  67.  
  68. ********* open window
  69.  
  70.     lea    window,a0
  71.     movea.l  intuit,A6
  72.     jsr     OpenWindow(A6)    ; call OpenWindow
  73.  
  74.     tst.l   D0
  75.     bne.s    windok
  76.     move.l    #10,ret        return code
  77.     bra    closeint    exit
  78.  
  79. windok    move.l    d0,windowpoint
  80.     move.l    d0,a0
  81.     moveq    #0,d0
  82.     moveq    #0,d1
  83.  
  84. **  Get layer information
  85.  
  86.     move.l    wd_WLayer(a0),layer    window layer
  87.     movea.l    wd_WScreen(a0),a1    screen pointer
  88.     lea    sc_LayerInfo(a1),a0     get Layer_info address
  89.     move.l    a0,layerinfo        save
  90.  
  91. ** Look for AmigaDOS window
  92.  
  93.     movea.l    windowpoint,a0
  94.     movea.l    wd_WScreen(a0),a1    screen pointer
  95.     move.l    sc_FirstWindow(a1),wbwin get first window
  96.     movea.l    wbwin,a0    first window
  97. titlook    movea.l    wd_Title(a0),a1    title
  98.     cmpa.l    #0,a1
  99.     beq.s    nextwin        no
  100.     lea    doswindow,a2    dos name
  101.     moveq    #7,d0        count
  102. 1$    cmpi.b    #' ',(a1)    blank?
  103.     bne    2$        no
  104.     adda.l    #1,a1        next one
  105.     bra.s    1$
  106. 2$    cmp.b    (a2)+,(a1)+    right one?
  107.     bne.s    nextwin        no
  108.     dbra    d0,1$
  109.     move.l    a0,wbwin    save
  110.     bra.s    addgad
  111.  
  112. nextwin    movea.l    wd_NextWindow(a0),a0 next one
  113.     cmpa.l    #0,a0
  114.     beq    notit        not found
  115.     bra.s    titlook
  116.  
  117. notit    clr.l    wbwin        dos window not found
  118.  
  119. addgad    movea.l    windowpoint,a0    window
  120.  
  121. * get Window->UserPort->mp_SigBit into D0
  122.  
  123.     movea.l wd_UserPort(a0),a1   A1 = Window->UserPort
  124.     moveq   #0,d0
  125.     move.b  MP_SIGBIT(a1),d0  D0 = the Window's mp_SigBit
  126.     moveq   #1,d1
  127.     lsl.l   d0,d1        ; D1 = windowSigs
  128.     or.l    d1,waitflags    update the waitFlags
  129.     move.l    d1,windowflag    save
  130.  
  131. * Find what task we are in, and install it in the msg ports
  132.  
  133.     sub.l   a1,a1           my task
  134.         move.l  sysbase,a6      Exec Lib Ptr
  135.         jsr     FindTask(a6)
  136.  
  137.         move.l  d0,d4        save task pointer
  138.  
  139. ****   get timer signal bit
  140.  
  141.     moveq   #-1,d0
  142.     jsr     AllocSignal(a6)     call AllocSignal
  143.     move.l    d0,d3        save signal bit
  144.     bmi    sigerr        exit
  145.  
  146. ** get port space
  147.  
  148. portall    moveq   #MP_SIZE,d0        size of structure
  149.     move.l  #MEMF_CLEAR+MEMF_PUBLIC,d1 memory type = CLEAR and PUBLIC
  150.     JSR     AllocMem(a6)    call AllocMem
  151.  
  152.     move.l  d0,timerport    save timer Port
  153.     bne    1$
  154.     move.l    #16,ret        return code
  155.     bra    openerr
  156.  
  157. 1$    movea.l    timerport,a1
  158.     move.b  d3,MP_SIGBIT(a1)    set signal bit
  159.     move.l    d4,MP_SIGTASK(a1)
  160.     move.l    #timerportname,LN_NAME(a1)    timer name
  161.     move.b  #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
  162.     move.b    #PA_SIGNAL,MP_FLAGS(a1)
  163.     moveq   #1,d1
  164.     lsl.l   d3,d1
  165.     or.l    d1,waitflags    update the waitFlags
  166.     move.l    d1,timerflag    timer wait flag    
  167.  
  168. ** add timer port
  169.  
  170.         move.l   timerport,a1     Message Port
  171.         jsr      AddPort(a6)   Add another Port to list
  172.  
  173.     lea    timerreq,a1    timer IORequest
  174.     move.b  #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
  175.     move.b  #0,LN_PRI(a1)     LN_PRI = 0
  176.     move.l  timerport,MN_REPLYPORT(a1) move in message port pointer
  177.  
  178. ***** open vblank timer device *****
  179.  
  180.     lea     TimerName(PC),a0    ; A0 = timer name
  181. * A1 = timeRequest
  182.     moveq   #1,d0        ; D0 = UNIT_VBLANK(1)
  183.     moveq   #0,d1
  184.     jsr     OpenDevice(A6)    ; call OpenDevice
  185.     tst.l   d0
  186.     bne     openerr2
  187.     move.w  #TR_ADDREQUEST,IO_COMMAND+timerreq IO_COMMAND = TR_ADDREQUEST(9)
  188.  
  189.  
  190. ** set the timeRequest to wait for refresh time
  191.  
  192.     move.l  #10,IO_SIZE+TV_SECS+timerreq    TV_SECS = 120
  193.     move.l  #0,IO_SIZE+TV_MICRO+timerreq    TV_MICRO= 0 ms
  194.  
  195.  
  196. ******** start the timer running
  197.  
  198.     lea    timerreq,a1
  199.     movea.l    4,a6        set Exec base
  200.     jsr     SendIO(A6)    ; call SendIO
  201.  
  202.  
  203. *** set up gadgets
  204.  
  205. ag
  206.     lea    gad0,a1        first gadget
  207.     movea.l    intuit,a6    intuition base
  208. ngad    movea.l    0(a1),a3    next gadget    
  209.     movea.l    windowpoint,a0    window
  210.     move.l    #0,d0        no requestors
  211.     jsr    AddGadget(a6)     add gadget
  212.     cmpa.l    #0,a3        another one?    
  213.     beq.s    nomoreg        no
  214.     movea.l    a3,a1        next one
  215.     bra    ngad
  216.  
  217. nomoreg    jsr    redogad
  218.  
  219. waitloop move.l  waitflags,D0    dD0 = waitFlags
  220.     movea.l    4,a6        Exec base
  221.     jsr     Wait(A6)    call Wait
  222.  
  223.     move.l    d0,d3        save signal
  224.     and.l    timerflag,d0    is it timer?
  225.     beq    getmsg        no must be from window
  226.  
  227. timeget    move.l    timerport,a0    get message form timer port
  228.     movea.l    4,a6        set Exec base
  229.     jsr     GetMsg(A6)    call GetMsg
  230.     tst.l    d0        any more?
  231.     beq.s    waitloop    no
  232.  
  233.     tst.b    pop        do popup?
  234.     beq.s    dopop        yes
  235.     bra    retime
  236. dopop    movea.l    layers,a6    layers base    
  237.     movea.l    layerinfo,a0    screen's layer info
  238.     movea.l    layer,a1    window's layer 
  239.  
  240.     jsr    UpfrontLayer(a6) pop
  241.  
  242.  
  243. ** set the timeRequest to wait for popup time
  244.  
  245. retime    move.l  #10,IO_SIZE+TV_SECS+timerreq    TV_SECS = 10
  246.     move.l  #0,IO_SIZE+TV_MICRO+timerreq    TV_MICRO= 0 ms
  247.  
  248.  
  249. ******** start the timer running
  250.  
  251.     lea    timerreq,A1
  252.     movea.l    4,a6        set Exec base
  253.     jsr     SendIO(A6)    ; call SendIO
  254.  
  255.     bra    waitloop
  256.  
  257. ** get msg
  258.  
  259. getmsg    movea.l    4,a6        set to Exec base
  260.     move.l    windowpoint,a1    window
  261.     movea.l wd_UserPort(a1),A0 A0 = window's UserPort
  262.     jsr     GetMsg(A6)     call GetMsg
  263.     tst.l   d0         D0 = message
  264.     beq    timeget      no more messages so start Waiting
  265.     movea.l d0,a1
  266.     move.l    im_Class(a1),class    save class
  267.     move.l    im_IAddress(a1),a3        save gadget adderss
  268.     jsr     ReplyMsg(a6)     call ReplyMessage
  269.  
  270.  
  271. intmsg    cmpi.l    #GADGETUP,class    gadget selected?
  272.     bne    activetst    no - see if act or deactivated 
  273.     
  274. *** Gadget selected. Branch to right routine
  275.  
  276.     moveq    #0,d0
  277.     move.w    gg_GadgetID(a3),d0 get gadget number
  278.     lsl.l    #2,d0        *4
  279.     lea    routines,a0    list of routine addresses
  280.     movea.l    0(a0,d0),a1    get routine    
  281.     jmp    0(a1)        go and do it
  282.     
  283. ** See if window was activated or deactivated
  284.  
  285. activetst cmpi.l #ACTIVEWINDOW,class activated?    
  286.     beq.s    redgad
  287.  
  288. tryinact cmpi.l    #INACTIVEWINDOW,class
  289.     bne    getmsg    no
  290. redgad    jsr    redogad
  291.     bra    getmsg
  292.  
  293.  
  294. ** routines
  295.  
  296. popup    eori.b    #3,gad8text        reset colour
  297.     eori.b    #-1,pop            set pop switch
  298.     bra    redos
  299.  
  300. dir    move.l    #'dir ',commandsave
  301.     move.b    #3,gad0text        first gadget text
  302.     move.b    #0,gad1text        second gadget text
  303. redos    jsr    actdos
  304.     jsr    redogad            reset gadgets    
  305.     bra    getmsg
  306.  
  307.  
  308. lrout    move.l    #$4c495354,commandsave
  309.     move.b    #0,gad0text        first gadget text
  310.     move.b    #3,gad1text        second gadget text
  311.     bra    redos
  312.  
  313. dir0    move.l    #'df0:',disksave set up disk
  314.     bra    execdir        execute it
  315.  
  316. dir1    move.l    #'df1:',disksave set up disk
  317.     bra    execdir        execute it
  318.  
  319. dirr    move.l    #'ram:',disksave set up disk
  320.     bra    execdir        execute it
  321.  
  322. dirv    move.l    #'vd0:',disksave set up disk
  323.     bra    execdir        execute it
  324.  
  325. info    jsr    actdos        reactivate dos window
  326.     jsr    opendos        open dos library
  327.     lea    infoc,a0    info command
  328.     bra    execinf
  329.  
  330. execdir    jsr    actdos        reactivate dos window
  331.     jsr    opendos        open dos library
  332.  
  333.     move.l    commandsave,command set up command
  334.     mvc    disksave,disk,4    move 4 bytes    
  335.     lea    command,a0    dir command string
  336. execinf    moveq    #0,d2        input handle
  337.     moveq    #0,d3        output file handle
  338.     move.l  a0,d1
  339.     move.l    dosbase,a6
  340.     jsr    Execute(a6)    Execute
  341.  
  342. *** close dos library
  343.  
  344. closedos move.l    sysbase,a6    Exec base
  345.         move.l  dosbase,a1         Close the DOS library
  346.         jsr     CloseLibrary(a6)
  347.     bra    getmsg    
  348.  
  349. openerr2  
  350.     move.l #18,ret        return code
  351.     movea.l sysbase,a6 
  352.     moveq    #0,d0        clear
  353.     movea.l    timerport,a0
  354.     move.b    MP_SIGBIT(a0),d0 get signal bit
  355.     jsr    FreeSignal(a6)    free it
  356.     bra    closeint
  357.  
  358. sigerr    move.l    #14,ret        return code    
  359.     bra    closewind
  360.  
  361. quit    
  362.     move.l    sysbase,a6
  363.     lea      timerreq,a1
  364.         jsr      AbortIO(a6)    abort timer
  365.  
  366. ** close timer device
  367.  
  368.     lea    timerreq,a1    timer IORequest
  369.     JSR     CloseDevice(a6)    ; call CloseDevice
  370.  
  371.     moveq    #0,d0        clear
  372.     movea.l    timerport,a0
  373.     move.b    MP_SIGBIT(a0),d0 get signal bit
  374.     jsr    FreeSignal(a6)    free it
  375.  
  376.         movea.l  timerport,a1      Remove the timer Port
  377.         jsr      RemPort(a6)
  378.  
  379. openerr
  380.     movea.l timerport,a1    timer IORequest
  381.     moveq   #MP_SIZE,D0    size of structure
  382.     jsr     FreeMem(A6)    call FreeMem
  383.  
  384. closewind movea.l  intuit,A6
  385.     move.l    windowpoint,a0    window 
  386.     jsr     CloseWindow(A6)     call CloseWindow
  387.  
  388. closeint move.l  sysbase,a6
  389.     move.l    intuit,a1
  390.     jsr    CloseLibrary(a6)    close intuition
  391.  
  392. layerbye move.l    layers,a1    layers
  393.     movea.l 4,a6        ; load exec library address
  394.     jsr     CloseLibrary(A6)     call CloseLibrary
  395.  
  396.         move.l   ret,d1          Return Code
  397.         move.l   d1,d0
  398.  
  399.     rts
  400.  
  401. *** Refresh gadgets
  402.  
  403. redogad    movea.l    windowpoint,a0    window
  404.     movea.l wd_RPort(a0),a0 window's RPort
  405.     lea     clear,a1     title
  406.     moveq   #0,d0
  407.     moveq   #0,d1
  408.     movea.l  intuit,A6
  409.     jsr     PrintIText(A6)     call PrintIText
  410.  
  411.     lea    gad8,a0        first gadget
  412.     movea.l    windowpoint,a1    window
  413.     movea.l    #0,a2        no requestors
  414.     jsr    RefreshGadgets(a6) redo gadgets
  415.     rts    
  416.  
  417. *** Reactivate dos window
  418.  
  419. actdos    tst.l    wbwin        did we find the dos window?
  420.     beq.s    nodos        no
  421.     movea.l    intuit,a6
  422.     movea.l    wbwin,a0    dos window
  423.     jsr    ActivateWindow(a6) activate it
  424. nodos    jsr    redogad        refresh gadgets
  425.     rts
  426.  
  427. * Open Dos library
  428.  
  429. opendos move.l   sysbase,a6        Pointer to Exec Library
  430.         lea      thedos(pc),a1     Point to title of DOS
  431.         moveq    #0,d0             Version number
  432.         jsr      OpenLibrary(a6)
  433.         move.l   d0,dosbase        DOS library Pointer
  434.         rts          
  435.  
  436. *** Long words
  437.  
  438. routines dc.l    dir,lrout,dir0,dir1,dirr,dirv,info,quit,popup
  439.     cnop    0,2
  440. commandsave dc.b 'dir '
  441.  
  442. ****************** window structure **********************
  443.  
  444.  
  445.  
  446. window    dc.w      2        left edge
  447.     dc.w    1        top edge        
  448. wwidth    dc.w    178        width
  449. wheight    dc.w    8        Height
  450.     dc.b    0        detail pen
  451.     dc.b    1        block pen
  452.     dc.l    GADGETUP+ACTIVEWINDOW+INACTIVEWINDOW IDCMPflags 
  453.     dc.l    BORDERLESS+NOCAREREFRESH+WINDOWDRAG flags 
  454.     dc.l    0        first gadget
  455.     dc.l    0        check mark
  456.     dc.l    0        title
  457.     dc.l    0        screen
  458.     dc.l    0        bit map
  459.     dc.w    0        minimum width
  460.     dc.w    0          minimum height
  461. wmax    dc.w    0        max width
  462. hmax    dc.w    0        max height
  463.     dc.w    1        workbench
  464.  
  465. ************   Gadgets **********
  466. gwidth    equ    18
  467. le    equ     4
  468.  
  469. gad0    dc.l    gad1        next gadget
  470.     dc.w    le        left edge    
  471.     dc.w    0        top edge
  472.     dc.w    gwidth        width
  473.     dc.w    8        height
  474.     dc.w    GADGHCOMP    flags
  475.     dc.w    RELVERIFY    activation flags
  476.     dc.w    BOOLGADGET    type
  477.     dc.l    0        border structure
  478.     dc.l    0        SelectRender
  479.     dc.l    gad0text    GadgetText
  480.     dc.l    0        MutualExclude
  481.     dc.l    0        SpecialInfo
  482.     dc.w    0        GadgetID
  483.     dc.l    0        UserData
  484.  
  485.  
  486. gad1    dc.l    gad2        next gadget
  487.     dc.w    le+gwidth*1        left edge    
  488.     dc.w    0        top edge
  489.     dc.w    gwidth        width
  490.     dc.w    8         height
  491.     dc.w    GADGHCOMP    flags
  492.     dc.w    RELVERIFY    activation flags
  493.     dc.w    BOOLGADGET    type
  494.     dc.l    0        border structure
  495.     dc.l    0        SelectRender
  496.     dc.l    gad1text    GadgetText
  497.     dc.l    0        MutualExclude
  498.     dc.l    0        SpecialInfo
  499.     dc.w    1        GadgetID
  500.     dc.l    0        UserData
  501.  
  502.  
  503. gad2    dc.l    gad3        next gadget
  504.     dc.w    le+gwidth*2        left edge    
  505.     dc.w    0        top edge
  506.     dc.w    gwidth        width
  507.     dc.w    8         height
  508.     dc.w    GADGHCOMP    flags
  509.     dc.w    RELVERIFY    activation flags
  510.     dc.w    BOOLGADGET    type
  511.     dc.l    0        border structure
  512.     dc.l    0        SelectRender
  513.     dc.l    gad2text    GadgetText
  514.     dc.l    0        MutualExclude
  515.     dc.l    0        SpecialInfo
  516.     dc.w    2        GadgetID
  517.     dc.l    0        UserData
  518.  
  519. gad3    dc.l    gad4        next gadget
  520.     dc.w    le+gwidth*3    left edge    
  521.     dc.w    0        top edge
  522.     dc.w    gwidth        width
  523.     dc.w    8         height
  524.     dc.w    GADGHCOMP    flags
  525.     dc.w    RELVERIFY    activation flags
  526.     dc.w    BOOLGADGET    type
  527.     dc.l    0        border structure
  528.     dc.l    0        SelectRender
  529.     dc.l    gad3text    GadgetText
  530.     dc.l    0        MutualExclude
  531.     dc.l    0        SpecialInfo
  532.     dc.w    3        GadgetID
  533.     dc.l    0        UserData
  534.  
  535.  
  536. gad4    dc.l    gad5        next gadget
  537.     dc.w    le+gwidth*4        left edge    
  538.     dc.w    0        top edge
  539.     dc.w    gwidth        width
  540.     dc.w    8         height
  541.     dc.w    GADGHCOMP    flags
  542.     dc.w    RELVERIFY    activation flags
  543.     dc.w    BOOLGADGET    type
  544.     dc.l    0        border structure
  545.     dc.l    0        SelectRender
  546.     dc.l    gad4text    GadgetText
  547.     dc.l    0        MutualExclude
  548.     dc.l    0        SpecialInfo
  549.     dc.w    4        GadgetID
  550.     dc.l    0        UserData
  551.  
  552.  
  553. gad5    dc.l    gad6        next gadget
  554.     dc.w    le+gwidth*5        left edge    
  555.     dc.w    0        top edge
  556.     dc.w    gwidth        width
  557.     dc.w    8         height
  558.     dc.w    GADGHCOMP    flags
  559.     dc.w    RELVERIFY    activation flags
  560.     dc.w    BOOLGADGET    type
  561.     dc.l    0        border structure
  562.     dc.l    0        SelectRender
  563.     dc.l    gad5text    GadgetText
  564.     dc.l    0        MutualExclude
  565.     dc.l    0        SpecialInfo
  566.     dc.w    5        GadgetID
  567.     dc.l    0        UserData
  568.  
  569.  
  570. gad6    dc.l    gad7        next gadget
  571.     dc.w    le+gwidth*6        left edge    
  572.     dc.w    0        top edge
  573.     dc.w    gwidth        width
  574.     dc.w    8         height
  575.     dc.w    GADGHCOMP    flags
  576.     dc.w    RELVERIFY    activation flags
  577.     dc.w    BOOLGADGET    type
  578.     dc.l    0        border structure
  579.     dc.l    0        SelectRender
  580.     dc.l    gad6text    GadgetText
  581.     dc.l    0        MutualExclude
  582.     dc.l    0        SpecialInfo
  583.     dc.w    6        GadgetID
  584.     dc.l    0        UserData
  585.  
  586.  
  587. gad7    dc.l    gad8        next gadget
  588.     dc.w    le+gwidth*7        left edge    
  589.     dc.w    0        top edge
  590.     dc.w    gwidth        width
  591.     dc.w    8         height
  592.     dc.w    GADGHCOMP    flags
  593.     dc.w    RELVERIFY    activation flags
  594.     dc.w    BOOLGADGET    type
  595.     dc.l    0        border structure
  596.     dc.l    0        SelectRender
  597.     dc.l    gad7text    GadgetText
  598.     dc.l    0        MutualExclude
  599.     dc.l    0        SpecialInfo
  600.     dc.w    7        GadgetID
  601.     dc.l    0        UserData
  602.  
  603.  
  604. gad8    dc.l    0        next gadget
  605.     dc.w    le+gwidth*8        left edge    
  606.     dc.w    0        top edge
  607.     dc.w    gwidth        width
  608.     dc.w    8         height
  609.     dc.w    GADGHCOMP    flags
  610.     dc.w    RELVERIFY    activation flags
  611.     dc.w    BOOLGADGET    type
  612.     dc.l    0        border structure
  613.     dc.l    0        SelectRender
  614.     dc.l    gad8text    GadgetText
  615.     dc.l    0        MutualExclude
  616.     dc.l    0        SpecialInfo
  617.     dc.w    8        GadgetID
  618.     dc.l    0        UserData
  619.  
  620.     cnop    0,2
  621. gad0text dc.b    3,1,1,0
  622.     dc.w    (gwidth-10)/2,1
  623.     dc.l    0,g0text,0
  624.  
  625.     cnop    0,2
  626. g0text    dc.b    'D',0
  627.  
  628.     cnop    0,2
  629. gad1text dc.b    0,1,0,0
  630.     dc.w    (gwidth-10)/2,1
  631.     dc.l    0,g1text,0
  632.  
  633.     cnop    0,2
  634. g1text    dc.b    'L',0
  635.  
  636.     cnop    0,2
  637. gad2text dc.b    0,1,0,0
  638.     dc.w    (gwidth-10)/2,1
  639.     dc.l    0,g2text,0
  640.  
  641.     cnop    0,2
  642. g2text    dc.b    '0',0
  643.  
  644.     cnop    0,2
  645. gad3text dc.b    0,1,0,0
  646.     dc.w    (gwidth-10)/2,1
  647.     dc.l    0,g3text,0
  648.  
  649.     cnop    0,2
  650. g3text    dc.b    '1',0
  651.  
  652.     cnop    0,2
  653. gad4text dc.b    0,1,0,0
  654.     dc.w    (gwidth-10)/2,1
  655.     dc.l    0,g4text,0
  656.  
  657.     cnop    0,2
  658. g4text    dc.b    'R',0
  659.  
  660.     cnop    0,2
  661. gad5text dc.b    0,1,0,0
  662.     dc.w    (gwidth-10)/2,1
  663.     dc.l    0,g5text,0
  664.  
  665.     cnop    0,2
  666. g5text    dc.b    'V',0
  667.  
  668.     cnop    0,2
  669. gad6text dc.b    0,1,0,0
  670.     dc.w    (gwidth-10)/2,1
  671.     dc.l    0,g6text,0
  672.  
  673.     cnop    0,2
  674. g6text    dc.b    'I',0
  675.  
  676.     cnop    0,2
  677. gad7text dc.b    0,1,0,0
  678.     dc.w    (gwidth-10)/2,1
  679.     dc.l    0,g7text,0
  680.  
  681.     cnop    0,2
  682. g7text    dc.b    'E',0
  683.  
  684.     cnop    0,2
  685. gad8text dc.b    3,1,0,0
  686.     dc.w    (gwidth-10)/2,1
  687.     dc.l    0,g8text,0
  688.  
  689.     cnop    0,2
  690. g8text    dc.b    'P',0
  691.  
  692.     cnop    0,2
  693. clear    dc.b    0,1,1,0
  694.     dc.w    0,0
  695.     dc.l    0,title,0
  696.  
  697.     cnop 0,2
  698. layersname dc.b    'layers.library',0
  699.     cnop    0,2
  700. IntuitionName dc.b 'intuition.library',0
  701.     cnop    0,2
  702. thedos   DOSNAME
  703.  
  704.     cnop    0,2
  705. doswindow dc.b    'AmigaDOS',0
  706.  
  707.     cnop     0,2
  708. title    dc.b    '                      ',0
  709.     cnop    0,2
  710. command    dc.b    'dir  '
  711. disk    dc.b    'df0:',0
  712.     cnop     0,2
  713. infoc    dc.b    'info',0
  714.     cnop    0,2
  715. TimerName DC.B    'timer.device',0
  716.  
  717.     cnop    0,2
  718. timerportname    DC.B    'dirbartimer',0
  719.  
  720.         section     vars,bss
  721.  
  722. startbss
  723.  
  724.             cnop     0,4
  725.  
  726.  
  727. * Long Words
  728.  
  729. layer        ds.l    1
  730. layers        ds.l    1
  731. layerinfo     ds.l    1
  732.  
  733. saveSP        ds.l    1         Initial Stack Pointer
  734. dosbase        ds.l    1    Base of Dos library
  735. intuit        ds.l    1    intuition library pointer
  736. windowpoint     ds.l     1    pointer to window
  737. waitflags     ds.l    1    flags to wait for
  738. wbwin        ds.l    1    pointer to dos window
  739. class        ds.l    1    class
  740. disksave    ds.l    1    disk name
  741. timerflag    ds.l    1    timer wait bit
  742. timerport    ds.l    1    timer MsgPort pointer
  743.         cnop    0,4
  744. timerreq    ds.b    IOTV_SIZE timer IOReq
  745. windowflag    ds.l    1    window wait bit
  746. ret        ds.l    1    return code
  747.  
  748. * Words
  749.  
  750. * Bytes
  751.  
  752. pop        ds.b    1        popup switch
  753.  
  754. endbss
  755.  
  756.  
  757.          end
  758.  
  759.